package com.qfedu.dao;

import com.qfedu.pojo.entity.GoodsInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @ClassName GoodsInfoRepository
 * @Description TODO
 * @Author young
 * @Date 2022-09-26 22:54
 * @Version 1.0
 **/
public interface GoodsInfoRepository extends JpaRepository<GoodsInfo,Integer> {

      //@Query(value = "select * from goodsinfo where goodsname like '%?1%'",nativeQuery = true)
      List<GoodsInfo> findByGoodsnameLike(String goodsName);

      @Query(value = "select * from goodsinfo where second_type_id = ?1",nativeQuery = true)
      List<GoodsInfo> findByType(Integer secondTypeId);

      List<GoodsInfo> findByHotId(Integer hotId);
}
